<?php
/**
 * Created by PhpStorm.
 * User: Jessewang
 * Date: 2017/3/26
 * Time: 下午9:48
 */

namespace App\Service;
use Swoole;
use Swoole\RandomKey;

class LikeService extends BaseService
{

    const  CACHE_KEY_LIKE =  "like#";
    function __construct()
    {

    }
    function like($srcid,$destid)
    {
        return    \Swoole::getInstance()->redis->sAdd(self::CACHE_KEY_LIKE.$destid,$srcid);
    }

    function getcount($userid)
    {
        return    \Swoole::getInstance()->redis->zCard(self::CACHE_KEY_LIKE.$userid);
    }
}